package main

import (
	"fmt"
)

func main()  {
	//数组打印
	test5()
	//单一条件循环
	test6()
	//经典循环
	test7()
	//死循环
	test8()

}




func test5(){
	var iarray1 [5]int32
	var iarray2 [5]int32 = [5]int32{1, 2, 3, 4, 5}
	iarray3 := [5]int32{1, 2, 3, 4, 5}
	iarray4 := [5]int32{6, 7, 8, 9, 10}
	iarray5 := [...]int32{11, 12, 13, 14, 15}
	iarray6 := [4][4]int32{{1}, {1, 2}, {1, 2, 3}}
	fmt.Println(iarray1)
	fmt.Println(iarray2)
	fmt.Println(iarray3)
	fmt.Println(iarray4)
	fmt.Println(iarray5)
	fmt.Println(iarray6)
}

func test6()  {
	i:=1
	for i<=3{
		fmt.Printf("单一条件循环:%d\n",i)
		i=i+1
	}
}

func test7(){
	for i:=5;i<=10 ;i++  {
		fmt.Printf("经典循环:%d\n",i)
	}
}

func test8()  {
	var k="Break"
	for {
		fmt.Printf("死循环加%s\n",k)
		break
	}
}